<?php
/**
 * Extractor Wysiwyg Interface Building
 * 
 * @author Xavier VILAIN
 * @package Orx\Etl\Extractor
 * @license #license-orx-etl#
 * 
 */

$xview = Xview::instance();
$extractorid = $xview->val('extractor',false);
try {
	$extractor = new Extractor($extractorid);
	$data = $extractor->getData();
	/* @var $source Orx\Etl\Extractor\Source */
	$source = $extractor->source();
	$items = array();
	$data = array_merge($data,$source->parse($data['params']));
	foreach($extractor->items() as $item) {
		$data['mapping'][] = $item->getData();
		$items[$item->position] = $item;
	}
} catch (Fox\Object\Exception\NotExist $e) {
	var_dump($e);
	//$xview->accessDenied();
} 

// Build Source List
$htmlSource = '<ul id="sourceFields">';
foreach($extractor->items() as $item) {
	$htmlSource .= '<li data-position="'.$item->position.'">'.$item->label().'</li>';
}
$htmlSource .= '</ul>'; 
// Build Target List

// Finale Display
?>
<div >
	<div class="leftColumn"></div>
	<div class="centerColumn"></div>
	<div class="rightColumn"></div>
</div>
